package com.kason.framework.protocol.dubbo;

import com.kason.framework.Invocation;
import com.kason.framework.Protocol;
import com.kason.framework.Remote;

import java.net.URL;

/**
 * @author 卢清波
 * @date 2021/2/19 18:54
 */
public class DubboProtocol implements Protocol
{

    @Override
    public void start(Remote remote)
    {
         NettyServer nettyServer = new NettyServer();
        try
        {
            nettyServer.start(remote.getHostname(),remote.getPort());
        }
        catch (InterruptedException e)
        {
            e.printStackTrace();
        }
    }

    @Override
    public String send(Remote remote, Invocation invocation) throws Exception
    {
         NettyClient nettyClient = new NettyClient();
        return nettyClient.send(remote, invocation);
    }
}
